import Cookie from "js-cookie";

export const cookie = {

    /**
     * 设置cookie
     * @param key
     * @param value
     * @param exist_day 有效期：天
     */
    set(key: string, value: any, exist_day = 30) {
        Cookie.set(key, value, {expires : exist_day});
    },

    /**
     * 获取value
     * @param key
     */
    get(key: string) {
        return Cookie.get(key);
    },

    /**
     * 移除键为key的cookie
     * @param key
     */
    remove(key: string) {
        Cookie.remove(key)
    }

}